Read data file.

## [1] "Columns: patient_id, encounter_id, admitted_dt_tm, age_in_years, age_in_days, patient_type_id, loinc_code, accession, lab_procedure_id, lab_procedure_mnemonic, unit_display, numeric_result"
## [1] "Patients: 214660; Encounters: 241460"

Tests in this dataset.

Lab tests in dataset, with value counts
Lab units N
Troponin I ng/mL 167280
Troponin T S/Pl ng/mL, ng/dL 166588
Troponin ng/mL, ng/dL 52788
Troponin I SerPl aCnc ng/mL 15398
Troponin I Bld Quant ng/mL 4455
Troponin I Ser/plasma DL<=0.01 ng/mL Quant ng/mL 122

Define biomarker[s] of interest.

## 1. Biomarker of interest: "Troponin I"
## 2. Biomarker of interest: "Troponin T S/Pl"

Describe dataset[s] for biomarker[s] of interest.

Summary of data for biomarker[s] of interest (2)
lab units mean median sd n
Troponin I ng/mL 1.03 0.02 11.07 167280
Troponin T S/Pl ng/mL 0.08 0.01 0.61 166326
## Troponin I; N = 167280; min = 0.0000; max = 1182.9400; mean = 1.0339; median = 0.0200; sd = 11.0724
Troponin I: distribution percentiles
percentiles values
0% 0.000
10% 0.010
20% 0.015
30% 0.015
40% 0.017
50% 0.020
60% 0.030
70% 0.046
80% 0.097
90% 0.360
100% 1182.940
## Troponin T S/Pl; N = 166326; min = 0.0000; max = 68.3000; mean = 0.0805; median = 0.0100; sd = 0.6062
Troponin T S/Pl: distribution percentiles
percentiles values
0% 0.00
10% 0.01
20% 0.01
30% 0.01
40% 0.01
50% 0.01
60% 0.01
70% 0.02
80% 0.02
90% 0.08
100% 68.30

Remove extreme and likely non-healthy or spurious values.

Although exclusion criteria are designed to filter for healthy patients with normal physiological lab values, removing extreme values can further filter to the same purpose.

## Troponin I: Extreme values removed: 38175 / 167280 (22.82%)
## Troponin I; N = 129105; min = 0.0110; max = 0.3590; mean = 0.0508; median = 0.0200; sd = 0.0673
## Troponin T S/Pl: Extreme values removed: 122549 / 166326 (73.68%)
## Troponin T S/Pl; N = 43777; min = 0.0110; max = 0.0790; mean = 0.0283; median = 0.0200; sd = 0.0146
## [1] "Columns: patient_id, patient_type_id, patient_type_desc, gender, race, ethnicity, age_mid_year, exclusion_flag, agegroup"

Patient cohort descriptive statistics

Remove patients with unknown gender or age

## [1] "Excluding patients with unknown gender: 10 / 41331 (0.024%) excluded"
## [1] "Excluding patients with unknown agegroup: 1193 / 41331 (2.886%) excluded"

Patient type

Note that patient type depends on the encounter, so a single patient can be multiple patient types for different encounters.

Labs: (Troponin I, Troponin T S/Pl) cohort, Patient_type distribution
Patient_type n_pt
Emergency 15289
Inpatient 5343
Observation 2019
Outpatient 714
Observation / Short stay / 24 hr stay 368
Non-Patient 146
Clinic 125
Laboratory 72
Not Mapped 69
Other Specialty 52
Unknown / Invalid 32
Community 25
Outpatient Surgery 20
HLA QC 18
Radiology 13
Day Surgery 6
Recurring 4
Urgent 4
Billing 1
Skilled Nursing Facility 1

Race

Labs: (Troponin I, Troponin T S/Pl) cohort, Race distribution
Race n_pt
Caucasian 18042
African American 4437
Other 733
Unknown 367
Asian 249
Native American 246
Hispanic 113
Asian/Pacific Islander 40
Biracial 32
NULL 27
Pacific Islander 21
Not Mapped 14

Age distribution

## [1] "Age_mid_year: N = 24321; min = 1.0; max = 90.6; mean = 62.2; median = 63.1; sd = 18.1"
Labs: (Troponin I, Troponin T S/Pl) cohort, Age_mid_year: distribution percentiles
percentiles values
0% 1.0
10% 36.6
20% 46.2
30% 53.0
40% 58.2
50% 63.1
60% 68.7
70% 74.0
80% 79.5
90% 86.0
100% 90.6

Stratified statistics and distributions

Initially, for sex and age-group. First merge lab value table[s] with stratification variables. Most common unit of measurement preferred, and if sufficient, others ignored.

Normal-physiological healthy patient cohort, stratified statistics
lab agegroup sex units mean median sd n boxplot
Troponin I
Troponin I 00-09 Female ng/mL 0.2280 0.228 NA 1
Troponin I 00-09 Male ng/mL 0.1422 0.135 0.1019 8
Troponin I 10-19 Female ng/mL 0.0230 0.017 0.0123 65
Troponin I 10-19 Male ng/mL 0.0431 0.020 0.0698 36
Troponin I 20-29 Female ng/mL 0.0261 0.015 0.0351 195
Troponin I 20-29 Male ng/mL 0.0385 0.017 0.0546 184
Troponin I 30-39 Female ng/mL 0.0311 0.017 0.0415 597
Troponin I 30-39 Male ng/mL 0.0392 0.020 0.0589 506
Troponin I 40-49 Female ng/mL 0.0297 0.017 0.0360 990
Troponin I 40-49 Male ng/mL 0.0377 0.020 0.0466 921
Troponin I 50-59 Female ng/mL 0.0315 0.017 0.0445 1661
Troponin I 50-59 Male ng/mL 0.0389 0.020 0.0557 1274
Troponin I 60-69 Female ng/mL 0.0438 0.020 0.0618 1727
Troponin I 60-69 Male ng/mL 0.0435 0.020 0.0546 1820
Troponin I 70-79 Female ng/mL 0.0418 0.020 0.0585 2049
Troponin I 70-79 Male ng/mL 0.0503 0.021 0.0652 1423
Troponin I 80-89 Female ng/mL 0.0463 0.020 0.0628 1499
Troponin I 80-89 Male ng/mL 0.0503 0.026 0.0634 998
Troponin I 90+ Female ng/mL 0.0547 0.036 0.0655 620
Troponin I 90+ Male ng/mL 0.0619 0.033 0.0705 251
Troponin T S/Pl
Troponin T S/Pl 10-19 Female ng/mL 0.0200 0.020 NA 1
Troponin T S/Pl 20-29 Female ng/mL 0.0251 0.020 0.0144 12
Troponin T S/Pl 20-29 Male ng/mL 0.0284 0.020 0.0222 10
Troponin T S/Pl 30-39 Female ng/mL 0.0234 0.020 0.0125 44
Troponin T S/Pl 30-39 Male ng/mL 0.0336 0.020 0.0189 31
Troponin T S/Pl 40-49 Female ng/mL 0.0237 0.020 0.0129 75
Troponin T S/Pl 40-49 Male ng/mL 0.0251 0.020 0.0130 52
Troponin T S/Pl 50-59 Female ng/mL 0.0245 0.020 0.0136 136
Troponin T S/Pl 50-59 Male ng/mL 0.0313 0.020 0.0174 133
Troponin T S/Pl 60-69 Female ng/mL 0.0276 0.020 0.0157 205
Troponin T S/Pl 60-69 Male ng/mL 0.0299 0.020 0.0180 155
Troponin T S/Pl 70-79 Female ng/mL 0.0245 0.020 0.0144 176
Troponin T S/Pl 70-79 Male ng/mL 0.0285 0.021 0.0144 165
Troponin T S/Pl 80-89 Female ng/mL 0.0267 0.020 0.0136 177
Troponin T S/Pl 80-89 Male ng/mL 0.0280 0.020 0.0142 153
Troponin T S/Pl 90+ Female ng/mL 0.0325 0.028 0.0173 99
Troponin T S/Pl 90+ Male ng/mL 0.0340 0.030 0.0165 76